package com.tbit.main.service.impl;

import com.tbit.main.constant.DaoParamConstant;
import com.tbit.main.dao.stat.OperationDayStaDao;
import com.tbit.main.pojo.OperationDaySta;
import com.tbit.main.service.OperationDayStaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author LMY
 * @create 2021-01-06 14:26
 * 运营分析日统计
 */
@Service("operationDaySta")
public class OperationDayStaServiceImpl implements OperationDayStaService {
    @Autowired
    private OperationDayStaDao operationDayStaDao;

    @Override
    public void insert(OperationDaySta operationDaySta) {
        operationDayStaDao.insert(operationDaySta);
    }

    @Override
    public void insertBatch(List<Map<String, Object>> list) {
        operationDayStaDao.insertBatch(list);
    }


    @Override
    public List<OperationDaySta> getByAccountDate(Integer accountId, String startDate, String endDate) {

        Map<String, Object> map = new HashMap<>();
        map.put(DaoParamConstant.accountId, accountId);
        map.put("startDate", startDate);
        map.put("endDate", endDate);
        return operationDayStaDao.getByAccountDate(map);
    }
}
